<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/pages/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加产品</title>
<script type="text/javascript">
function checkForm(){
	var proModel=document.getElementById("proModel").value;
	var proName=document.getElementById("proName").value;
	var file=document.getElementById("file").value;
	var proDescribe=document.getElementById("proDescribe").value;
	var proFunction=document.getElementById("proFunction").value;
	var cId=document.getElementById("cId").value;

	if(proModel==null||proModel==""){
		alert("请输入产品型号！");
		return false;
		};
	if(proName==null||proName==""){
		alert("请输入产品名称！");
		return false;
		};
	if(file=null||file==""){
		alert("请上传产品图片！");
		return false;
	}
	if(proDescribe=null||proDescribe==""){
		alert("请输入产品介绍！");
		return false;
	}
	if(proFunction=null||proFunction==""){
		alert("请输入产品功能！");
		return false;
	}
	if(cId==0){
		alert("请选择产品类别！");
		return false;
	}
		return true;
	
}
</script>
</head>
<body>
<div id="mainDiv" class="x-panel">
<div id="titleDiv" class="x-panel-header"><!--  此处是附页标题  注2 --></div>
<div id="bodyDiv">
<div id="toolbarDiv" class="x-toolbar"><!-- 此处是工具栏    注3--></div>
<div id="panelBodyDiv" class="x-panel-body"><!-- 此处是主体部分    注4-->
<form id="proForm" name="proForm" method="post" target="_self" action="${ctx}/proInfo.do?method=addProInfo" onsubmit="return checkForm();" enctype="multipart/form-data">
<table width="100%" class="datatable">
	<tr>
		<th align="right" width="15%">产品型号：</th>
		<td align="left"><input type="text" size="45"
			name="proModel" id="proModel" />
		</td>
	</tr>
	<tr>
		<th align="right" width="15%">产品名称：</th>
		<td align="left"><input type="text" size="20"
			name="proName" id="proName"/></td>
	</tr>
	<tr>
		<th align="right" width="15%">产品图片：</th>
		<td align="left">
		<input type="file" id="file" name="file">
		</td>
	</tr>
	<tr>
		<th align="right" width="15%">产品介绍：</th>
		<td align="left"><textarea rows="6" cols="60" name="proDescribe" id="proDescribe"></textarea>
		
	</tr>
	<tr>
		<th align="right" width="15%">主要功能：</th>
		<td align="left"><textarea rows="6" cols="60" name="proFunction" id="proFunction"></textarea>
		
	</tr>
	<tr>
		<th align="right" width="15%">是否推荐：</th>
		<td>
			 <input type="radio" name="commendFlag" value="1"checked="checked" />是 
			<input type="radio" name="commendFlag" value="0" />否</td>
	</tr>
	<tr>
		<th align="right" width="15%">产品类型：</th>
		<td align="left"><select name="cId" id="cId">
		<option value="0" selected>选择类型</option>
			<c:forEach var="pClass" items="${list}">
				<option value="${pClass.cId}">${pClass.className}</option>
			</c:forEach>
		</select></td>
	</tr>
	<tr>
		<th></th>
		<td align="center"><input type="submit" value="提交"/>
		&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" />
		</td>
	</tr>
</table>
</form>
</div>
</div>
</div>
</body>
</html>